<h2>Managing Owner</h2>

<div class="actionBar">
[<?php echo CHtml::link('Owner List',array('list')); ?>]
[<?php echo CHtml::link('New Owner',array('create')); ?>]
</div>

<table class="dataGrid">
  <thead>
  <tr>
    <th><?php echo $sort->link('id'); ?></th>
    <th><?php echo $sort->link('first_name'); ?></th>
    <th><?php echo $sort->link('last_name'); ?></th>
    <th><?php echo $sort->link('gender'); ?></th>
    <th><?php echo $sort->link('birth_date'); ?></th>
    <th><?php echo $sort->link('address1'); ?></th>
    <th><?php echo $sort->link('address2'); ?></th>
    <th><?php echo $sort->link('address3'); ?></th>
    <th><?php echo $sort->link('city_id'); ?></th>
    <th><?php echo $sort->link('email'); ?></th>
    <th><?php echo $sort->link('referent'); ?></th>
    <th><?php echo $sort->link('service_id'); ?></th>
    <th><?php echo $sort->link('adviser_initials'); ?></th>
	<th>Actions</th>
  </tr>
  </thead>
  <tbody>
<?php foreach($models as $n=>$model): ?>
  <tr class="<?php echo $n%2?'even':'odd';?>">
    <td><?php echo CHtml::link($model->id,array('show','id'=>$model->id)); ?></td>
    <td><?php echo CHtml::encode($model->first_name); ?></td>
    <td><?php echo CHtml::encode($model->last_name); ?></td>
    <td><?php echo CHtml::encode($model->gender); ?></td>
    <td><?php echo CHtml::encode($model->birth_date); ?></td>
    <td><?php echo CHtml::encode($model->address1); ?></td>
    <td><?php echo CHtml::encode($model->address2); ?></td>
    <td><?php echo CHtml::encode($model->address3); ?></td>
    <td><?php echo CHtml::encode($model->city_id); ?></td>
    <td><?php echo CHtml::encode($model->email); ?></td>
    <td><?php echo CHtml::encode($model->referent); ?></td>
    <td><?php echo CHtml::encode($model->service_id); ?></td>
    <td><?php echo CHtml::encode($model->adviser_initials); ?></td>
    <td>
      <?php echo CHtml::link('Update',array('update','id'=>$model->id)); ?>
      <?php echo CHtml::linkButton('Delete',array(
      	  'submit'=>'',
      	  'params'=>array('command'=>'delete','id'=>$model->id),
      	  'confirm'=>"Are you sure to delete #{$model->id}?")); ?>
	</td>
  </tr>
<?php endforeach; ?>
  </tbody>
</table>
<br/>
<?php $this->widget('CLinkPager',array('pages'=>$pages)); ?>